package com.tanjie.blackbean.schedule.support;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: tanjie
 * @date: 2022-04-14
 **/
public abstract class TaskHolder {

    private TaskHolder() {
    }

    private static final Map<String, AbstractTask> taskMap;

    static {
        taskMap = new HashMap<>();
    }

    public static void addTask(String name, AbstractTask task) {
        taskMap.put(name, task);
    }

    public static AbstractTask get(String name) {
        return taskMap.get(name);
    }

}
